#pragma once

#include <gofcl_usart_r.h>

typedef struct {
	u32_s ERRIE : 1;
	u32_s IREN : 1;
	u32_s IRLP : 1;
	u32_s HDEN : 1;
	u32_s NKEN : 1;
	u32_s SCEN : 1;
	u32_s DENR : 1;
	u32_s DENT : 1;
	u32_s RTSEN : 1;
	u32_s CTSEN : 1;
	u32_s CTSIE : 1;
	u32_s : 21;
} usart_ctl2_s;

_Static_assert(sizeof(usart_ctl2_s) == 4, "Struct usart_ctl2_s defined error!");

static inline void usart_wreg_ctl2_s(usart_qe usart_q, usart_ctl2_s ctl2) {
	union {
		usart_ctl2_s c;
		u32_s u;
	} cu = {
		.c = ctl2,
	};
	usart_wreg(usart_q, USART_CTL2_R, cu.u);
}
